﻿<UserControl x:Class="ImportPersons.ImportPersonsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="218" d:DesignWidth="541">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <TextBlock Text="Import Users" FontSize="16" FontWeight="Bold" Grid.ColumnSpan="2" Margin="8" Foreground="#445566" HorizontalAlignment="Center"/>
        <StackPanel Grid.Row="1"  Orientation="Horizontal" Margin="8">
            <TextBlock Text="File to import:" Margin="0,0,4,0" VerticalAlignment="Center"/>
            <TextBox Text="{Binding Filename,Mode=TwoWay}" Width="400"/>
        </StackPanel>
        <ItemsControl Grid.Row="2" Margin="4" ItemsSource="{Binding People}">
            <ItemsControl.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Width="120" Text="{Binding FirstName}"/>
                        <TextBlock Width="120" Text="{Binding LastName}" Margin="4,0,0,0"/>
                    </StackPanel>
                </DataTemplate>
            </ItemsControl.ItemTemplate>
        </ItemsControl>
        <Button Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="8" Command="{Binding ImportCommand}" Content="Import" Width="80" />
        <Border Width="200" Height="25" Grid.RowSpan="10" BorderThickness="1" BorderBrush="Black" CornerRadius="2" Visibility="{Binding ProgressVisibility}">
            <Rectangle Fill="#40a060" Margin="1" >
                <Rectangle.RenderTransform>
                    <ScaleTransform ScaleX="{Binding ProgressValue}"/>
                </Rectangle.RenderTransform>
            </Rectangle>
        </Border>
    </Grid>
</UserControl>
